<template>
	<view class="evalu">
		<u--textarea v-model="info.content" placeholder="请输入点评信息"></u--textarea>
		<view class="shjia">
			<view class="shjiatitle">
				您对商家满意吗？
			</view>
			<view class="shjiainfo">
				<image src="https://s1.ax1x.com/2022/05/14/O6Bj4e.png"></image>
				<view>新禾农场</view>
			</view>
			<view class="sjdafen">
				<view>
					商家评分:
				</view>
				<u-rate size="30" :minCount="1" :count="count" v-model="info.goodsScore"></u-rate>
			</view>
			<view class="sjdafen">
				<view>
					服务评分:
				</view>
				<u-rate size="30" :minCount="1" :count="count" v-model="info.serviceScore"></u-rate>
			</view>
		</view>
		<u-button text="提交" shape="circle" type="success" @click="Tj()"></u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {
					orderNo: '',
					goodsId: '',
					content: '',
					goodsScore: '',
					serviceScore: ''
				},
				count: 5
			}
		},
		methods: {
			Tj() {
				this.$http({
					url: '/crmOrderComment/insCrmOrderComment',
					data: this.info
				}).then(res => {
					if (res.data.data == 1) {
						uni.showToast({
							title: '提交成功'
						}).then(uni.navigateBack({
							delta: 1
						}))
					} else {
						uni.showToast({
							title: '提交失败',
							icon: 'error'
						})
					}
				})
			}
		},
		onLoad(option) {
			this.info.orderNo = option.orderNo
			this.info.goodsId = option.goodsId
		}
	}
</script>

<style>
	.u-button {
		width: 85% !important;
		margin: 50rpx auto;
		background: #88A58A !important;
		box-sizing: border-box;
		border: 1px solid #88A58A !important;
	}

	.evalu {
		overflow: hidden;
		background-color: #F8F8F8;
		height: calc(100vh - 90rpx);
		width: 100%;
	}

	.u-textarea {
		width: 90%;
		margin: 20rpx auto;
	}

	.shjia {
		width: 93%;
		height: 25vh;
		margin: auto;
		border-radius: 50rpx;
		background-color: white;
		overflow: hidden;
		margin-top: 40rpx;
	}

	.shjiatitle {
		margin-left: 30rpx;
		margin-top: 30rpx;
	}

	.sjdafen {
		margin-top: 30rpx;
		margin-left: 50rpx;
		display: flex;
		align-items: center;
	}

	.sjdafen view {
		margin-right: 10rpx;
	}

	image {
		width: 10%;
		height: 4vh;
	}

	.shjiainfo {
		margin-top: 30rpx;
		margin-left: 50rpx;
		display: flex;
		align-items: center;
	}

	.shjiainfo view {
		margin-left: 20rpx;
	}
</style>
